package p270jp.pxv.android.activity;

import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import androidx.activity.ComponentActivity;
import androidx.compose.p026ui.platform.C0536v1;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.MaterialToolbar;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import p014ae.C0066d9;
import p014ae.C0078f9;
import p014ae.Hilt_UserProfileActivity;
import p014ae.View$OnClickListenerC0158t;
import p045be.UserProfileRecyclerAdapter;
import p047bg.C1124a;
import p064c6.Preconditions;
import p108di.RecyclerViewSmoothScrollForAppbarScrollListener;
import p134ei.AnalyticsScreenName;
import p165fo.C3114c;
import p165fo.Subscribe;
import p183gh.ABTestService;
import p184gi.ImpDetailEvent;
import p187gl.C3353b;
import p187gl.PixivRequest;
import p189gn.AbstractC3435a;
import p189gn.AbstractC3446l;
import p210hh.PixivAccountManager;
import p216hn.Lambda;
import p216hn.Reflection;
import p270jp.pxv.android.R;
import p270jp.pxv.android.activity.UserProfileActivity;
import p270jp.pxv.android.event.LoadUserContentEvent;
import p270jp.pxv.android.event.OpenUrlEvent;
import p270jp.pxv.android.event.UpdateFollowEvent;
import p270jp.pxv.android.event.UpdateMuteEvent;
import p270jp.pxv.android.legacy.event.ShowMuteSettingEvent;
import p270jp.pxv.android.legacy.model.PixivIllust;
import p270jp.pxv.android.legacy.model.PixivNovel;
import p270jp.pxv.android.legacy.model.PixivUser;
import p270jp.pxv.android.model.PixivIllustSeriesDetail;
import p270jp.pxv.android.response.PixivResponse;
import p270jp.pxv.android.userProfile.flux.UserProfileActionCreator;
import p270jp.pxv.android.userProfile.flux.UserProfileStore;
import p292km.UserProfileSettings;
import p307l9.EdgeTreatment;
import p310lc.C4621b;
import p314lg.ActivityUserProfileBinding;
import p325m0.MutabilityOwnership;
import p350mp.Timber;
import p370ni.Restrict;
import p467rd.subscribers;
import p579vo.Qualifier;
import p603wm.AbstractC6949c;
import p603wm.Unit;
import p639y6.C7294j;
import p645yc.AndroidSchedulers;
import p665z6.C7464s;
import p671zc.CompositeDisposable;
import p671zc.Disposable;
import p677zi.PixivImageLoader;

/* compiled from: UserProfileActivity.kt */
/* renamed from: jp.pxv.android.activity.UserProfileActivity */
/* loaded from: classes2.dex */
public final class UserProfileActivity extends Hilt_UserProfileActivity {

    /* renamed from: u0 */
    public static final /* synthetic */ int f18681u0;

    /* renamed from: c0 */
    public UserProfileRecyclerAdapter f18683c0;

    /* renamed from: g0 */
    public long f18687g0;

    /* renamed from: h0 */
    public PixivUser f18688h0;

    /* renamed from: i0 */
    public boolean f18689i0;

    /* renamed from: j0 */
    public boolean f18690j0;

    /* renamed from: k0 */
    public boolean f18691k0;

    /* renamed from: l0 */
    public boolean f18692l0;

    /* renamed from: m0 */
    public boolean f18693m0;

    /* renamed from: n0 */
    public boolean f18694n0;

    /* renamed from: o0 */
    public boolean f18695o0;

    /* renamed from: p0 */
    public float f18696p0;

    /* renamed from: b0 */
    public final AnalyticsScreenName f18682b0 = AnalyticsScreenName.USER_PROFILE;

    /* renamed from: d0 */
    public final AbstractC6949c f18684d0 = C4621b.m3851a(this, C4119b.f18702c);

    /* renamed from: e0 */
    public final AbstractC6949c f18685e0 = new ViewModelLazy(Reflection.m5499a(UserProfileActionCreator.class), new C4136s(this), new C4135r(this));

    /* renamed from: f0 */
    public final AbstractC6949c f18686f0 = new ViewModelLazy(Reflection.m5499a(UserProfileStore.class), new C4138u(this), new C4137t(this));

    /* renamed from: q0 */
    public final CompositeDisposable f18697q0 = new CompositeDisposable();

    /* renamed from: r0 */
    public final AbstractC6949c f18698r0 = Preconditions.m9802P(1, new C4132o(this, null, null));

    /* renamed from: s0 */
    public final AbstractC6949c f18699s0 = Preconditions.m9802P(1, new C4133p(this, null, null));

    /* renamed from: t0 */
    public final AbstractC6949c f18700t0 = Preconditions.m9802P(1, new C4134q(this, null, null));

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$a */
    /* loaded from: classes2.dex */
    public class C4118a implements Animator.AnimatorListener {

        /* renamed from: a */
        public final /* synthetic */ UserProfileActivity f18701a;

        public C4118a(UserProfileActivity userProfileActivity) {
            MutabilityOwnership.m3745m(userProfileActivity, "this$0");
            this.f18701a = userProfileActivity;
        }

        @Override // android.animation.Animator.AnimatorListener
        public void onAnimationCancel(Animator animator) {
            MutabilityOwnership.m3745m(animator, "animation");
        }

        @Override // android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            MutabilityOwnership.m3745m(animator, "animation");
            this.f18701a.f18695o0 = false;
        }

        @Override // android.animation.Animator.AnimatorListener
        public void onAnimationRepeat(Animator animator) {
            MutabilityOwnership.m3745m(animator, "animation");
        }

        @Override // android.animation.Animator.AnimatorListener
        public void onAnimationStart(Animator animator) {
            MutabilityOwnership.m3745m(animator, "animation");
            this.f18701a.f18695o0 = true;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$c */
    /* loaded from: classes2.dex */
    public static final class C4120c extends Lambda implements AbstractC3446l<PixivResponse, Unit> {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4120c() {
            super(1);
            UserProfileActivity.this = r1;
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(PixivResponse pixivResponse) {
            PixivResponse pixivResponse2 = pixivResponse;
            UserProfileRecyclerAdapter m2Var = UserProfileActivity.this.f18683c0;
            if (m2Var != null) {
                List<PixivIllust> list = pixivResponse2.illusts;
                String str = pixivResponse2.nextUrl;
                EdgeTreatment.m3909i(list);
                m2Var.f4797i = list;
                m2Var.f4804p = str;
                int indexOf = m2Var.f4792d.indexOf(UserProfileRecyclerAdapter.EnumC1090a.m10344a(1));
                if (indexOf != -1) {
                    m2Var.m10785f(indexOf);
                }
                return Unit.f29503a;
            }
            MutabilityOwnership.m3737u("adapter");
            throw null;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$d */
    /* loaded from: classes2.dex */
    public static final class C4121d extends Lambda implements AbstractC3446l<Throwable, Unit> {

        /* renamed from: a */
        public static final C4121d f18704a = new C4121d();

        public C4121d() {
            super(1);
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(Throwable th) {
            Throwable th2 = th;
            MutabilityOwnership.m3745m(th2, "throwable");
            Timber.f23100a.mo3514p(th2);
            return Unit.f29503a;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$e */
    /* loaded from: classes2.dex */
    public static final class C4122e extends Lambda implements AbstractC3446l<PixivResponse, Unit> {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4122e() {
            super(1);
            UserProfileActivity.this = r1;
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(PixivResponse pixivResponse) {
            PixivResponse pixivResponse2 = pixivResponse;
            UserProfileRecyclerAdapter m2Var = UserProfileActivity.this.f18683c0;
            if (m2Var != null) {
                List<PixivNovel> list = pixivResponse2.novels;
                EdgeTreatment.m3909i(list);
                m2Var.f4800l = list;
                if (list.size() == 0) {
                    UserProfileRecyclerAdapter.EnumC1090a a = UserProfileRecyclerAdapter.EnumC1090a.m10344a(6);
                    int indexOf = m2Var.f4792d.indexOf(a);
                    m2Var.f4792d.remove(a);
                    m2Var.m10783h(indexOf);
                } else {
                    int indexOf2 = m2Var.f4792d.indexOf(UserProfileRecyclerAdapter.EnumC1090a.m10344a(6));
                    if (indexOf2 != -1) {
                        m2Var.m10785f(indexOf2);
                    }
                }
                return Unit.f29503a;
            }
            MutabilityOwnership.m3737u("adapter");
            throw null;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$f */
    /* loaded from: classes2.dex */
    public static final class C4123f extends Lambda implements AbstractC3446l<Throwable, Unit> {

        /* renamed from: a */
        public static final C4123f f18706a = new C4123f();

        public C4123f() {
            super(1);
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(Throwable th) {
            Throwable th2 = th;
            MutabilityOwnership.m3745m(th2, "throwable");
            Timber.f23100a.mo3514p(th2);
            return Unit.f29503a;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$g */
    /* loaded from: classes2.dex */
    public static final class C4124g extends Lambda implements AbstractC3446l<PixivResponse, Unit> {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4124g() {
            super(1);
            UserProfileActivity.this = r1;
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(PixivResponse pixivResponse) {
            PixivResponse pixivResponse2 = pixivResponse;
            UserProfileRecyclerAdapter m2Var = UserProfileActivity.this.f18683c0;
            if (m2Var != null) {
                List<PixivIllust> list = pixivResponse2.illusts;
                String str = pixivResponse2.nextUrl;
                EdgeTreatment.m3909i(list);
                m2Var.f4799k = list;
                m2Var.f4805q = str;
                if (list.size() == 0) {
                    UserProfileRecyclerAdapter.EnumC1090a a = UserProfileRecyclerAdapter.EnumC1090a.m10344a(5);
                    int indexOf = m2Var.f4792d.indexOf(a);
                    m2Var.f4792d.remove(a);
                    m2Var.m10783h(indexOf);
                } else {
                    int indexOf2 = m2Var.f4792d.indexOf(UserProfileRecyclerAdapter.EnumC1090a.m10344a(5));
                    if (indexOf2 != -1) {
                        m2Var.m10785f(indexOf2);
                    }
                }
                return Unit.f29503a;
            }
            MutabilityOwnership.m3737u("adapter");
            throw null;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$h */
    /* loaded from: classes2.dex */
    public static final class C4125h extends Lambda implements AbstractC3446l<Throwable, Unit> {

        /* renamed from: a */
        public static final C4125h f18708a = new C4125h();

        public C4125h() {
            super(1);
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(Throwable th) {
            Throwable th2 = th;
            MutabilityOwnership.m3745m(th2, "throwable");
            Timber.f23100a.mo3514p(th2);
            return Unit.f29503a;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$i */
    /* loaded from: classes2.dex */
    public static final class C4126i extends Lambda implements AbstractC3446l<PixivResponse, Unit> {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4126i() {
            super(1);
            UserProfileActivity.this = r1;
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(PixivResponse pixivResponse) {
            PixivResponse pixivResponse2 = pixivResponse;
            UserProfileRecyclerAdapter m2Var = UserProfileActivity.this.f18683c0;
            if (m2Var != null) {
                List<PixivIllust> list = pixivResponse2.illusts;
                String str = pixivResponse2.nextUrl;
                EdgeTreatment.m3909i(list);
                m2Var.f4798j = list;
                m2Var.f4803o = str;
                int indexOf = m2Var.f4792d.indexOf(UserProfileRecyclerAdapter.EnumC1090a.m10344a(3));
                if (indexOf != -1) {
                    m2Var.m10785f(indexOf);
                }
                return Unit.f29503a;
            }
            MutabilityOwnership.m3737u("adapter");
            throw null;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$j */
    /* loaded from: classes2.dex */
    public static final class C4127j extends Lambda implements AbstractC3446l<Throwable, Unit> {

        /* renamed from: a */
        public static final C4127j f18710a = new C4127j();

        public C4127j() {
            super(1);
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(Throwable th) {
            Throwable th2 = th;
            MutabilityOwnership.m3745m(th2, "throwable");
            Timber.f23100a.mo3514p(th2);
            return Unit.f29503a;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$k */
    /* loaded from: classes2.dex */
    public static final class C4128k extends Lambda implements AbstractC3446l<PixivResponse, Unit> {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4128k() {
            super(1);
            UserProfileActivity.this = r1;
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(PixivResponse pixivResponse) {
            PixivResponse pixivResponse2 = pixivResponse;
            UserProfileRecyclerAdapter m2Var = UserProfileActivity.this.f18683c0;
            if (m2Var != null) {
                List<PixivNovel> list = pixivResponse2.novels;
                EdgeTreatment.m3909i(list);
                m2Var.f4801m = list;
                int indexOf = m2Var.f4792d.indexOf(UserProfileRecyclerAdapter.EnumC1090a.m10344a(4));
                if (indexOf != -1) {
                    m2Var.m10785f(indexOf);
                }
                return Unit.f29503a;
            }
            MutabilityOwnership.m3737u("adapter");
            throw null;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$l */
    /* loaded from: classes2.dex */
    public static final class C4129l extends Lambda implements AbstractC3446l<Throwable, Unit> {

        /* renamed from: a */
        public static final C4129l f18712a = new C4129l();

        public C4129l() {
            super(1);
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(Throwable th) {
            Throwable th2 = th;
            MutabilityOwnership.m3745m(th2, "throwable");
            Timber.f23100a.mo3514p(th2);
            return Unit.f29503a;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$m */
    /* loaded from: classes2.dex */
    public static final class C4130m extends Lambda implements AbstractC3446l<PixivResponse, Unit> {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4130m() {
            super(1);
            UserProfileActivity.this = r1;
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(PixivResponse pixivResponse) {
            PixivResponse pixivResponse2 = pixivResponse;
            UserProfileRecyclerAdapter m2Var = UserProfileActivity.this.f18683c0;
            if (m2Var != null) {
                List<PixivIllustSeriesDetail> list = pixivResponse2.illustSeriesDetails;
                EdgeTreatment.m3909i(list);
                m2Var.f4802n = list;
                int indexOf = m2Var.f4792d.indexOf(UserProfileRecyclerAdapter.EnumC1090a.m10344a(2));
                if (indexOf != -1) {
                    m2Var.m10785f(indexOf);
                }
                return Unit.f29503a;
            }
            MutabilityOwnership.m3737u("adapter");
            throw null;
        }
    }

    /* compiled from: UserProfileActivity.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$n */
    /* loaded from: classes2.dex */
    public static final class C4131n extends Lambda implements AbstractC3446l<Throwable, Unit> {

        /* renamed from: a */
        public static final C4131n f18714a = new C4131n();

        public C4131n() {
            super(1);
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(Throwable th) {
            Throwable th2 = th;
            MutabilityOwnership.m3745m(th2, "throwable");
            Timber.f23100a.mo3514p(th2);
            return Unit.f29503a;
        }
    }

    /* compiled from: ComponentCallbackExt.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$o */
    /* loaded from: classes2.dex */
    public static final class C4132o extends Lambda implements AbstractC3435a<UserProfileSettings> {

        /* renamed from: a */
        public final /* synthetic */ ComponentCallbacks f18715a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4132o(ComponentCallbacks componentCallbacks, Qualifier aVar, AbstractC3435a aVar2) {
            super(0);
            this.f18715a = componentCallbacks;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [km.a, java.lang.Object] */
        @Override // p189gn.AbstractC3435a
        public final UserProfileSettings invoke() {
            return C1124a.m10173s(this.f18715a).f24118a.m920a().m621a(Reflection.m5499a(UserProfileSettings.class), null, null);
        }
    }

    /* compiled from: ComponentCallbackExt.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$p */
    /* loaded from: classes2.dex */
    public static final class C4133p extends Lambda implements AbstractC3435a<PixivImageLoader> {

        /* renamed from: a */
        public final /* synthetic */ ComponentCallbacks f18716a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4133p(ComponentCallbacks componentCallbacks, Qualifier aVar, AbstractC3435a aVar2) {
            super(0);
            this.f18716a = componentCallbacks;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [java.lang.Object, zi.a] */
        @Override // p189gn.AbstractC3435a
        public final PixivImageLoader invoke() {
            return C1124a.m10173s(this.f18716a).f24118a.m920a().m621a(Reflection.m5499a(PixivImageLoader.class), null, null);
        }
    }

    /* compiled from: ComponentCallbackExt.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$q */
    /* loaded from: classes2.dex */
    public static final class C4134q extends Lambda implements AbstractC3435a<ABTestService> {

        /* renamed from: a */
        public final /* synthetic */ ComponentCallbacks f18717a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4134q(ComponentCallbacks componentCallbacks, Qualifier aVar, AbstractC3435a aVar2) {
            super(0);
            this.f18717a = componentCallbacks;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [gh.a, java.lang.Object] */
        @Override // p189gn.AbstractC3435a
        public final ABTestService invoke() {
            return C1124a.m10173s(this.f18717a).f24118a.m920a().m621a(Reflection.m5499a(ABTestService.class), null, null);
        }
    }

    /* compiled from: ActivityViewModelLazy.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$r */
    /* loaded from: classes2.dex */
    public static final class C4135r extends Lambda implements AbstractC3435a<ViewModelProvider.AbstractC0728b> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f18718a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4135r(ComponentActivity componentActivity) {
            super(0);
            this.f18718a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelProvider.AbstractC0728b invoke() {
            ViewModelProvider.AbstractC0728b defaultViewModelProviderFactory = this.f18718a.getDefaultViewModelProviderFactory();
            MutabilityOwnership.m3746l(defaultViewModelProviderFactory, "defaultViewModelProviderFactory");
            return defaultViewModelProviderFactory;
        }
    }

    /* compiled from: ActivityViewModelLazy.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$s */
    /* loaded from: classes2.dex */
    public static final class C4136s extends Lambda implements AbstractC3435a<ViewModelStore> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f18719a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4136s(ComponentActivity componentActivity) {
            super(0);
            this.f18719a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelStore invoke() {
            ViewModelStore viewModelStore = this.f18719a.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "viewModelStore");
            return viewModelStore;
        }
    }

    /* compiled from: ActivityViewModelLazy.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$t */
    /* loaded from: classes2.dex */
    public static final class C4137t extends Lambda implements AbstractC3435a<ViewModelProvider.AbstractC0728b> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f18720a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4137t(ComponentActivity componentActivity) {
            super(0);
            this.f18720a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelProvider.AbstractC0728b invoke() {
            ViewModelProvider.AbstractC0728b defaultViewModelProviderFactory = this.f18720a.getDefaultViewModelProviderFactory();
            MutabilityOwnership.m3746l(defaultViewModelProviderFactory, "defaultViewModelProviderFactory");
            return defaultViewModelProviderFactory;
        }
    }

    /* compiled from: ActivityViewModelLazy.kt */
    /* renamed from: jp.pxv.android.activity.UserProfileActivity$u */
    /* loaded from: classes2.dex */
    public static final class C4138u extends Lambda implements AbstractC3435a<ViewModelStore> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f18721a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4138u(ComponentActivity componentActivity) {
            super(0);
            this.f18721a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelStore invoke() {
            ViewModelStore viewModelStore = this.f18721a.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "viewModelStore");
            return viewModelStore;
        }
    }

    public UserProfileActivity() {
        super(R.layout.activity_user_profile);
    }

    /* renamed from: e1 */
    public static final Intent m4690e1(Context context, long j) {
        MutabilityOwnership.m3745m(context, "context");
        EdgeTreatment.m3910h(j > 0);
        Intent intent = new Intent(context, UserProfileActivity.class);
        intent.putExtra("USER_ID", j);
        return intent;
    }

    /* renamed from: f1 */
    public final UserProfileActionCreator m4689f1() {
        return (UserProfileActionCreator) this.f18685e0.getValue();
    }

    /* renamed from: g1 */
    public final ActivityUserProfileBinding m4688g1() {
        return (ActivityUserProfileBinding) this.f18684d0.getValue();
    }

    /* renamed from: h1 */
    public final PixivImageLoader m4687h1() {
        return (PixivImageLoader) this.f18699s0.getValue();
    }

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        MaterialToolbar materialToolbar = m4688g1().f22528i;
        MutabilityOwnership.m3746l(materialToolbar, "binding.toolBar");
        C0536v1.m11536i(this, materialToolbar, "");
        long longExtra = getIntent().getLongExtra("USER_ID", -1);
        this.f18687g0 = longExtra;
        Timber.f23100a.mo3528a(String.valueOf(longExtra), new Object[0]);
        m4688g1().f22521b.m8753a(new AppBarLayout.AbstractC2080f() { // from class: ae.a9
            @Override // com.google.android.material.appbar.AppBarLayout.AbstractC2075a
            /* renamed from: a */
            public final void mo8724a(AppBarLayout appBarLayout, int i) {
                UserProfileActivity userProfileActivity = UserProfileActivity.this;
                int i2 = UserProfileActivity.f18681u0;
                MutabilityOwnership.m3745m(userProfileActivity, "this$0");
                float f = userProfileActivity.f18696p0;
                if (!(f == 0.0f)) {
                    float f2 = (((float) i) + f) / f;
                    if (f2 < 0.5f) {
                        userProfileActivity.m4688g1().f22534o.setVisibility(4);
                    } else {
                        userProfileActivity.m4688g1().f22534o.setVisibility(0);
                        userProfileActivity.m4688g1().f22534o.setScaleX(f2);
                        userProfileActivity.m4688g1().f22534o.setScaleY(f2);
                        userProfileActivity.m4688g1().f22534o.setAlpha((f2 * ((float) 2)) - ((float) 1));
                    }
                }
                if (!userProfileActivity.f18695o0) {
                    if (appBarLayout.getMeasuredHeight() + i == userProfileActivity.m4688g1().f22528i.getMeasuredHeight()) {
                        if (userProfileActivity.m4688g1().f22531l.getVisibility() != 0) {
                            userProfileActivity.m4688g1().f22531l.setVisibility(0);
                            Animator loadAnimator = AnimatorInflater.loadAnimator(userProfileActivity, R.animator.fade_in_user_profile_tool_bar);
                            loadAnimator.setTarget(userProfileActivity.m4688g1().f22531l);
                            loadAnimator.addListener(new UserProfileActivity.C4118a(userProfileActivity));
                            loadAnimator.start();
                        }
                    } else if (userProfileActivity.m4688g1().f22531l.getVisibility() == 0) {
                        Animator loadAnimator2 = AnimatorInflater.loadAnimator(userProfileActivity, R.animator.fade_out_user_profile_tool_bar);
                        loadAnimator2.setTarget(userProfileActivity.m4688g1().f22531l);
                        loadAnimator2.addListener(new C0061c9(userProfileActivity));
                        loadAnimator2.start();
                    }
                }
            }
        });
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(1, false);
        m4688g1().f22527h.setLayoutManager(linearLayoutManager);
        m4688g1().f22527h.m10869h(new RecyclerViewSmoothScrollForAppbarScrollListener(linearLayoutManager, m4688g1().f22521b, m4688g1().f22528i));
        this.f18683c0 = new UserProfileRecyclerAdapter(m4687h1(), this.f18757A, (ABTestService) this.f18700t0.getValue());
        RecyclerView recyclerView = m4688g1().f22527h;
        UserProfileRecyclerAdapter m2Var = this.f18683c0;
        if (m2Var != null) {
            recyclerView.setAdapter(m2Var);
            UserProfileSettings aVar = (UserProfileSettings) this.f18698r0.getValue();
            if (!aVar.f20396a.getBoolean(aVar.f20397b, false) && this.f18687g0 != PixivAccountManager.m5511e().f16499e) {
                m4688g1().f22522c.setVisibility(0);
                m4688g1().f22522c.setText(R.string.follow_long_press_explanation);
                m4688g1().f22522c.setOnCloseButtonClicked(new View$OnClickListenerC0158t(this, 8));
                Animator loadAnimator = AnimatorInflater.loadAnimator(getApplicationContext(), R.animator.fade_in_and_slide_up);
                loadAnimator.setStartDelay(500);
                loadAnimator.setTarget(m4688g1().f22522c);
                loadAnimator.start();
            }
            ((UserProfileStore) this.f18686f0.getValue()).f19452e.mo2790a(this, new p014ae.UserProfileActivity(this));
            m4689f1().m4514d(this.f18687g0);
            this.f18757A.m6526d(new ImpDetailEvent.C3341c(this.f18687g0, null));
            this.f18757A.m6524f(this.f18682b0, Long.valueOf(this.f18687g0));
            return;
        }
        MutabilityOwnership.m3737u("adapter");
        throw null;
    }

    @Override // androidx.activity.ComponentActivity, android.app.Activity
    public boolean onCreateOptionsMenu(Menu menu) {
        MutabilityOwnership.m3745m(menu, "menu");
        getMenuInflater().inflate(R.menu.menu_user_profile, menu);
        return true;
    }

    @Override // p014ae.AdActivity, p270jp.pxv.android.activity.BaseActivity, p116e.ActivityC2727f, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onDestroy() {
        this.f18697q0.m80f();
        m4688g1().f22527h.m10859m();
        super.onDestroy();
    }

    @Subscribe
    public final void onEvent(LoadUserContentEvent loadUserContentEvent) {
        Restrict dVar = Restrict.PUBLIC;
        MutabilityOwnership.m3745m(loadUserContentEvent, "event");
        switch (loadUserContentEvent.getViewType()) {
            case 1:
                if (!this.f18689i0) {
                    long userId = loadUserContentEvent.getUserId();
                    long j = this.f18687g0;
                    if (userId == j) {
                        this.f18689i0 = true;
                        Disposable g = subscribers.m2589g(PixivRequest.m5808i(j).m986o(AndroidSchedulers.m334a()), C4131n.f18714a, null, new C4120c(), 2);
                        CompositeDisposable aVar = this.f18697q0;
                        MutabilityOwnership.m3744n(aVar, "compositeDisposable");
                        aVar.mo82c(g);
                        return;
                    }
                    return;
                }
                return;
            case 2:
                if (!this.f18694n0) {
                    long userId2 = loadUserContentEvent.getUserId();
                    long j2 = this.f18687g0;
                    if (userId2 == j2) {
                        this.f18694n0 = true;
                        Disposable g2 = subscribers.m2589g(PixivAccountManager.m5511e().m5514b().m989l(new C3353b(j2, 1)).m986o(AndroidSchedulers.m334a()), C4129l.f18712a, null, new C4130m(), 2);
                        CompositeDisposable aVar2 = this.f18697q0;
                        MutabilityOwnership.m3744n(aVar2, "compositeDisposable");
                        aVar2.mo82c(g2);
                        return;
                    }
                    return;
                }
                return;
            case 3:
                if (!this.f18690j0) {
                    long userId3 = loadUserContentEvent.getUserId();
                    long j3 = this.f18687g0;
                    if (userId3 == j3) {
                        this.f18690j0 = true;
                        Disposable g3 = subscribers.m2589g(PixivRequest.m5807j(j3).m986o(AndroidSchedulers.m334a()), C4125h.f18708a, null, new C4126i(), 2);
                        CompositeDisposable aVar3 = this.f18697q0;
                        MutabilityOwnership.m3744n(aVar3, "compositeDisposable");
                        aVar3.mo82c(g3);
                        return;
                    }
                    return;
                }
                return;
            case 4:
                if (!this.f18691k0) {
                    long userId4 = loadUserContentEvent.getUserId();
                    long j4 = this.f18687g0;
                    if (userId4 == j4) {
                        this.f18691k0 = true;
                        Disposable g4 = subscribers.m2589g(PixivRequest.m5806k(j4).m986o(AndroidSchedulers.m334a()), C4127j.f18710a, null, new C4128k(), 2);
                        CompositeDisposable aVar4 = this.f18697q0;
                        MutabilityOwnership.m3744n(aVar4, "compositeDisposable");
                        aVar4.mo82c(g4);
                        return;
                    }
                    return;
                }
                return;
            case 5:
                if (!this.f18692l0) {
                    long userId5 = loadUserContentEvent.getUserId();
                    long j5 = this.f18687g0;
                    if (userId5 == j5) {
                        this.f18692l0 = true;
                        Disposable g5 = subscribers.m2589g(PixivAccountManager.m5511e().m5514b().m989l(new C7464s(j5, dVar, (String) null)).m986o(AndroidSchedulers.m334a()), C4123f.f18706a, null, new C4124g(), 2);
                        CompositeDisposable aVar5 = this.f18697q0;
                        MutabilityOwnership.m3744n(aVar5, "compositeDisposable");
                        aVar5.mo82c(g5);
                        return;
                    }
                    return;
                }
                return;
            case 6:
                if (!this.f18693m0) {
                    long userId6 = loadUserContentEvent.getUserId();
                    long j6 = this.f18687g0;
                    if (userId6 == j6) {
                        this.f18693m0 = true;
                        Disposable g6 = subscribers.m2589g(PixivAccountManager.m5511e().m5514b().m989l(new C7294j(j6, dVar, (String) null)).m986o(AndroidSchedulers.m334a()), C4121d.f18704a, null, new C4122e(), 2);
                        CompositeDisposable aVar6 = this.f18697q0;
                        MutabilityOwnership.m3744n(aVar6, "compositeDisposable");
                        aVar6.mo82c(g6);
                        return;
                    }
                    return;
                }
                return;
            default:
                return;
        }
    }

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, androidx.activity.ComponentActivity, android.app.Activity
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        MutabilityOwnership.m3745m(menuItem, "item");
        int itemId = menuItem.getItemId();
        if (itemId == R.id.menu_share) {
            PixivUser pixivUser = this.f18688h0;
            if (pixivUser != null) {
                String format = String.format(Locale.US, "%s https://www.pixiv.net/users/%d", Arrays.copyOf(new Object[]{pixivUser.name, Long.valueOf(pixivUser.f19078id)}, 2));
                MutabilityOwnership.m3746l(format, "java.lang.String.format(locale, format, *args)");
                Intent intent = new Intent("android.intent.action.SEND");
                intent.setType("text/plain");
                intent.putExtra("android.intent.extra.TEXT", format);
                startActivity(Intent.createChooser(intent, null));
            }
            return true;
        } else if (itemId == R.id.menu_mute) {
            C3114c.m6284b().m6280f(new ShowMuteSettingEvent(this.f18688h0));
            return true;
        } else {
            if (itemId == R.id.menu_report) {
                long j = this.f18687g0;
                Intent intent2 = new Intent(this, ReportUserActivity.class);
                intent2.putExtra("user_id", j);
                startActivity(intent2);
            }
            return super.onOptionsItemSelected(menuItem);
        }
    }

    @Override // android.app.Activity
    public boolean onPrepareOptionsMenu(Menu menu) {
        MutabilityOwnership.m3745m(menu, "menu");
        if (PixivAccountManager.m5511e().f16499e == this.f18687g0) {
            menu.findItem(R.id.menu_mute).setVisible(false);
            menu.findItem(R.id.menu_report).setVisible(false);
        }
        return super.onPrepareOptionsMenu(menu);
    }

    @Subscribe
    public final void onEvent(OpenUrlEvent openUrlEvent) {
        MutabilityOwnership.m3745m(openUrlEvent, "event");
        startActivity(new Intent("android.intent.action.VIEW", openUrlEvent.getUri()));
    }

    @Subscribe
    public final void onEvent(UpdateMuteEvent updateMuteEvent) {
        MutabilityOwnership.m3745m(updateMuteEvent, "event");
        this.f18689i0 = false;
        this.f18694n0 = false;
        this.f18690j0 = false;
        this.f18691k0 = false;
        this.f18692l0 = false;
        this.f18693m0 = false;
        m4688g1().f22527h.setAdapter(null);
        this.f18683c0 = new UserProfileRecyclerAdapter(m4687h1(), this.f18757A, (ABTestService) this.f18700t0.getValue());
        RecyclerView recyclerView = m4688g1().f22527h;
        UserProfileRecyclerAdapter m2Var = this.f18683c0;
        if (m2Var != null) {
            recyclerView.setAdapter(m2Var);
            m4689f1().m4514d(this.f18687g0);
            return;
        }
        MutabilityOwnership.m3737u("adapter");
        throw null;
    }

    @Subscribe
    public final void onEvent(UpdateFollowEvent updateFollowEvent) {
        MutabilityOwnership.m3745m(updateFollowEvent, "event");
        PixivUser pixivUser = this.f18688h0;
        if (pixivUser != null) {
            long userId = updateFollowEvent.getUserId();
            long j = this.f18687g0;
            if (userId == j && pixivUser.isFollowed) {
                Disposable g = subscribers.m2589g(PixivRequest.m5804m(j).m986o(AndroidSchedulers.m334a()), C0066d9.f323a, null, new C0078f9(this), 2);
                CompositeDisposable aVar = this.f18697q0;
                MutabilityOwnership.m3744n(aVar, "compositeDisposable");
                aVar.mo82c(g);
            }
        }
    }
}
